
	     //修改律师提成发票面板
    	 var modifyInvoicePanel;
     	//修改律师提成发票窗口
     	 var modifyInvoiceWin;
     	 //修改律师提成发票记录
     	  function modifyInvoiceFun(){
		 //获取要修改的一条记录
       	 var record=grid.getSelectionModel().getSelected();
       	//如果用户没有选择
       	if(!record){
       		Ext.MessageBox.alert('修改操作','请选择要修改的一项！');
       	   }else{
       		//修改律师提成发票窗口
       		modifyInvoiceWin=new Ext.Window({
       			layout:'fit',
       			width:500,
       			height:230,
       			closeAction:'hide',
				title:'修改律师提成发票窗口',
				items:modifyInvoicePanel
       		});
       		//显示窗口
       		modifyInvoiceWin.show();
       		//加载原数据
       		 Ext.getCmp("mInvoiceId").setValue(record.get("invoicenumber"));
       		 Ext.getCmp("mInvoiceTime").setValue(record.get("invoicetime"));
       		 Ext.getCmp("mContract").setValue(record.get("contractnumber"));
       		 Ext.getCmp("mInvoicePerson").setValue(record.get("invoiceperson"));
       		 Ext.getCmp("mInvoiceAmount").setValue(record.get("invoicemoney"));
       	     Ext.getCmp("mInvoiceRemark").setValue(record.get("invoiceremark"));
       	}
       }

       //修改律师提成发票面板
       modifyRoyaltyInvoicePanel=new Ext.form.FormPanel({
        labelAlign:'right',
        buttonAlign:'center',
       	collapsible:true,
       	labelwidth:100,
       	frame:true,
       	bodyStyle : 'padding:5px 5px 0',
        waitMsgTarget : true,

        defaults : {
            width : 250
        },
        defaultType : 'textfield',
        items : [
         {
            fieldLabel : '发票编号',
            itemCls:'float-left',//向左浮动
		    clearCls:'allow-float',//允许浮动
            name :'mRoyaltyInvoiceId',
            id :'mRoyaltyInvoiceId',
            allowBlank :false
        },
        {
            fieldLabel : '发票开出时间',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'mRoyaltyInvoiceTime',
            id :'mRoyaltyInvoiceTime',
            allowBlank :false
        },
        {
            fieldLabel : '合同号',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'mRoyaltyContract',
            id :'mRoyaltyContract',
            allowBlank :false
        },

        {
            fieldLabel :'金额',
			id :'mRoyaltyInvoiceAmount',
			name :'mRoyaltyInvoiceAmount',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			allowBlank :false
        },
        {
            fieldLabel :'经手人',
			id :'mRoyaltyInvoicePerson',
			name :'mRoyaltyInvoicePerson',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			allowBlank :false
        },
        {
            fieldLabel :'备注',
			id :'mRoyaltyInvoiceRemark',
			name :'mRoyaltyInvoiceRemark',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			allowBlank :false
        }
        ],

        buttons : [ {
            text : '保存',
            disabled : false,
            handler : function() {
                if (modifyRoyaltyInvoicePanel.form.isValid()) {
                    modifyRoyaltyInvoicePanel.form.submit( {
                        url : 'ModifyRoyaltyInvoiceInfo.jsj',
                        success : function(from, action) {
                        Ext.MessageBox.alert('更新结果', action.result.message);
                            store.load( {
                                params : {
                                    start : 0,
                                    limit : 5
                                }
                            });
                            modifyRoyaltyInvoiceWin.hide();
                        },
                        failure : function(form, action) {
                           Ext.MessageBox.alert('更新结果', action.result.message);
                            store.load( {
                                params : {
                                    start : 0,
                                    limit : 5
                                }
                            });
                            modifyRoyaltyInvoiceWin.hide();
                        },
                        waitMsg : '正在保存数据，稍后...'
                    });
                } else {
                    Ext.Msg.alert('信息', '请填写完成再提交!');
                }
            }
        }, {
            text : '取消',
            handler : function() {
                modifyRoyaltyInvoiceWin.hide();
            }
        }]
       })

